﻿@(Layout = null)
@if (Model == null)
{ 
    @ViewData.ModelMetadata.NullDisplayText 
}
else if (ViewData.TemplateInfo.TemplateDepth > 1)
{ 
    @ViewData.ModelMetadata.SimpleDisplayText 
}
else
{
    <table class="default">
        <tbody>
            @foreach (var prop in ViewData.ModelMetadata.Properties.Where(pm => HtmlExtensions.ShouldShow(pm,
            ViewData.TemplateInfo)))
            {
                <tr>
                    @*                    @if (prop.HideSurroundingHtml)
                    {
                        @Html.Display(prop.PropertyName)
                    }
                    else
                    {
                        if (!String.IsNullOrEmpty(prop.GetDisplayName()))
                        {
                        <td  align="right" style="width:30%">@prop.GetDisplayName()
                        </td>
                        }
                        <td style="width:70%">@Html.Display(prop.PropertyName)
                        </td>
                    }*@
                    @if (!String.IsNullOrEmpty(prop.GetDisplayName()))
                    {
                        <td align="right" style="width: 30%">@prop.GetDisplayName()
                        </td>
                    }
                    <td style="width: 70%">@Html.Display(prop.PropertyName)
                    </td>
                </tr>
            }
        </tbody>
    </table>
}
